package com.ktkj.init.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.ktkj.init.entity.Attachment;
import org.springframework.web.multipart.MultipartFile;

import javax.servlet.http.HttpServletResponse;


public interface AttachmentService extends IService<Attachment> {

    /**
     * 下载文件
     *
     * @author :yanlixiong
     * @date :2020-04-14 17:53:10
     */
    void downloadFile(String fileName, HttpServletResponse response);

    /**
     * 预览文件
     *
     * @author :yanlixiong
     * @date :2020-04-14 17:53:10
     */
    void previewFile(String fileName, HttpServletResponse response);

    /**
     * 返回文件流
     *
     * @author :yanlixiong
     * @date :2020-04-14 17:53:10
     */
    void responseFileStream(String fileName, HttpServletResponse response, String header);

    /**
     * 附件上传
     *
     * @author :yanlixiong@eversec.cn
     * @date :2020-04-14 17:53:10
     */
    Attachment uploadFileLocalPath(MultipartFile file, String fileName, String modelName);

    /**
     * 附件上传-FTP
     *
     * @author :yanlixiong@eversec.cn
     * @date :2020-04-14 17:53:10
     */
    Attachment uploadFileFtpPath(MultipartFile file, String fileName, String modelName);

    /**
     * 下载文件-FTP.
     *
     * @param ftpFileName the ftp file name
     * @param modelName   the model name
     */
    String downloadFileByFtp(String ftpFileName, String modelName);

}
